package com.hb.guli.service.edu.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.hb.guli.service.base.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * <p>
 * 课程
 * </p>
 *
 * @author jack
 * @since 2023-06-30
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("edu_course")
@ApiModel(value = "Course对象", description = "课程")
public class Course extends BaseEntity {

    private static final long serialVersionUID = 1L;

    // 未发布
    public static final String COURSE_DRAFT = "Draft";
    // 已发布
    public static final String COURSE_NORMAL = "Normal";

    @ApiModelProperty("课程讲师ID")
    private String teacherId;

    @ApiModelProperty("课程专业ID")
    private String subjectId;

    @ApiModelProperty("课程专业父级ID")
    private String subjectParentId;

    @ApiModelProperty("课程标题")
    private String title;

    @ApiModelProperty("课程销售价格，设置为0则可免费观看")
    private BigDecimal price;

    @ApiModelProperty("总课时")
    private Integer lessonNum;

    @ApiModelProperty("课程封面图片路径")
    private String cover;

    @ApiModelProperty("销售数量")
    private Long buyCount;

    @ApiModelProperty("浏览数量")
    private Long viewCount;

    @ApiModelProperty("乐观锁")
    @Version
    private Long version;

    @ApiModelProperty("课程状态 Draft未发布  Normal已发布")
    @TableField("`status`")
    private String status;

    @ApiModelProperty("逻辑删除 1（true）已删除， 0（false）未删除")
    @TableLogic
    @TableField("is_deleted")
    private Byte deleted;
}
